package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.article.util.TravelCondition;
import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class TravelQueryObject extends QueryObject {
    private Long destId = -1L;

    private int dayType = -1;

    private int travelTimeType =-1;

    private int perExpendType = -1;

    private int orderType = 1;

    public TravelCondition getDays(){
        return TravelCondition.dayType.get(dayType);
    }
    public TravelCondition getTravelTime(){
        return TravelCondition.travelTimeType.get(travelTimeType);
    }

    public TravelCondition getPerExpend(){
        return TravelCondition.perExpendType.get(perExpendType);
    }
    //排序
    public String getOrderBy(){
        if (orderType==1){
            return "t.createTime desc";
        }else if (orderType==2){
            return "t.viewnum desc";
        }else {
            return "t.createTime desc";
        }
    }
}
